//
//  Common.h
//  AiShangJinFuSalesman
//
//  Created by AiShangTong on 2017/6/5.
//  Copyright © 2018年 AiShangTong. All rights reserved.



////////////////////////////////////////////////////////////////////
//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//         佛祖保佑       永无BUG     永不修改                  //
////////////////////////////////////////////////////////////////////

//      ┏┛ ┻━━━━━┛ ┻┓
//      ┃         ┃
//      ┃   ━     ┃
//      ┃ ┳┛   ┗┳ ┃
//      ┃         ┃
//      ┃   ┻     ┃
//      ┃         ┃
//      ┗━┓   ┏━━━┛
//        ┃   ┃   神兽保佑
//        ┃   ┃   代码无BUG！
//        ┃   ┗━━━━━━━━━┓
//        ┃           ┣┓
//        ┃             ┏┛
//        ┗━┓ ┓ ┏━━━┳ ┓ ┏━┛
//          ┃ ┫ ┫   ┃ ┫ ┫
//          ┗━┻━┛   ┗━┻━┛


//

#import <UIKit/UIKit.h>

#define ApplicationEnvironmentProduction 1   //0表示测试环境 1表示线上环境

#define ApplicationBackGauge 12  //到手机屏幕边缘的间距
#define ApplicationNavigationBarBackGauge 13.5 //导航栏图片距屏幕边缘间距
#define ApplicationTextFieldHeight 40  //textField 的高度
//机型判断
#define iPhoneX ScreenHeight > 800.0
#define SafeAreaTopHeight (ScreenHeight > 800.0 ? 88 : 64)
#define SafeAreaBottomHeight (ScreenHeight > 800.0 ? 34 : 0)
//颜色值转换
#define RGBCOLOR(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
#define HexColor(hexValue) [Common hexColor:hexValue]
#define ThemeMaoColor HexColor(0xBA915E)//主题色
#define ThemeMaoBackgroundColorBar HexColor(0x999999) //HexColor(0xefeff4)
#define ThemeMaoBlackColor HexColor(0x333333)//常规字颜色
#define ThemeMaoBackgroundColor HexColor(0x999999)//浅灰
#define ThemeTintFontColor HexColor(0x666666)//浅色字体
#define ThemeMaoRedColor HexColor(0xFF2244)//红色

#define ThemeMaoLineColor HexColor(0xE6E6E6)

#define ListMaoBackgroundColor HexColor(0xF6F6F6)//通用的列表样式的背景色
#define ThemeSearchTextFieldBackColor HexColor(0xF2F2F2)//搜索界面搜索输入框的背景色
#define ScreenBounds [Common screenBounds]
#define ScreenWidthMao ScreenBounds.size.width
#define ScreenHeight ScreenBounds.size.height
#define UIBarButtonItemFont [UIFont systemFontOfSize:16]
#define SystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]

#define UIFontBoldCustom(size) [Common boldSystemFontOfSize:size]
#define UIFontCustom(size) [Common systemFontOfSize:size]

#define UIFontMaoLargest [Common systemFontOfSize:18]
#define UIFontMaoLarge [Common systemFontOfSize:16]
#define UIFontMaoNormal [Common systemFontOfSize:14]
#define UIFontMaoSmall [Common systemFontOfSize:12]
#define UIFontMaoMoreSmall [Common systemFontOfSize:10]
#define UIFontMaoSmallest [Common systemFontOfSize:9]
#define UIFontMaoMoreSmallest [Common systemFontOfSize:8]

//大头照通知
#define UserHeaderIconNotification @"UserHeaderIconNotification"


//空值判断
#define IsNilString(__String) (__String==nil || [__String isEqualToString:@""]|| [__String isEqualToString:@"null"])
//字符串相等
#define IsEquallString(_Str1,_Str2)  [_Str1 isEqualToString:_Str2]


#define AD_UserDefaults [NSUserDefaults standardUserDefaults]



#pragma mark ---枚举信息----

//证件类型
extern NSString *const Enumeration_ID_TYPE;
//政治面貌
extern NSString *const Enumeration_political;
//户口性质
extern NSString *const Enumeration_household;
//婚姻状况
extern NSString *const Enumeration_marriStatus;
//在职状态
extern NSString *const Enumeration_jobStatus;
//民族
extern NSString *const Enumeration_nation;
//学历
extern NSString *const Enumeration_education;
//性别
extern NSString *const Enumeration_sex;

#pragma mark ----登录信息-----
//登录Token 
extern NSString *const ASJFMyUserLoginTokenKey;
//用户账号 NSString
extern NSString *const ASJFMyUserInfoAccountKey;
//用户个人姓名信息
extern NSString *const ASJFUserNameKey;
//身份编码
static NSString *const ASJFMyUserIdentityCardNumber = @"ASJFMyUserIdentityCardNumber";
//区域信息
static NSString *const ASJF_Area = @"area_JinFuThree";



@interface Common : NSObject

/**
 *  16进制RGB色
 *
 *  @param hexValue RGB值 16进制
 */
+ (UIColor*) hexColor:(NSInteger)hexValue;

/**
 *  屏幕尺寸
 */
+ (CGRect) screenBounds;

/**
 * 根据颜色生成图片
 */
+(UIImage*) imageWithFrame:(CGRect)frame color:(UIColor*)color;

+(UIFont*)systemFontOfSize:(CGFloat)size;

+(UIFont*)boldSystemFontOfSize:(CGFloat)size;

+(BOOL)isVariableWithClass:(Class)cls varName:(NSString *)name;

+ (NSString *)ServicesURL:(NSString *)url;


+(BOOL)loginState;

//判断网络
+(BOOL)checkNetWork;

@end
